var obj = {
  id: "0001",
  type: "donut",
  name: "Cake",
  ppu: 0.55,
  batters: {
    batter: [
      { id: "1001", type: "Regular" },
      { id: "1002", type: "Chocolate" },
    ],
  },
  topping: [
    { id: "5001", type: "None" },
    { id: "5002", type: "Glazed" },
  ],
};

// console.log(JSON.stringify(obj, ["topping", "id"], 2));

// var obj2json = {
//   name: "dx",
//   firstName: "l",
//   age: 25,
//   toJSON() {
//       return `{fullName:${this.firstName}${this.name},age:${this.age}}`
//   },
// };console.log(JSON.stringify(obj2json,(key,v)=>{
//     console.log("key",key)
//     console.log("v",v)
//     return v
// },2));

const user = {
  name: "patrick Singh",
  age: 26,
};


console.log(JSON.stringify(user,(k,v)=>{
    console.log('k',k)
    console.log('v',v)
    console.log(typeof v)
    console.log("-----")
    if(typeof v=="string"){
        return undefined
    }
    return v
},"***"))